﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Configuration;
using DAL;
using Common;


public partial class Customer_SelectReceiver : System.Web.UI.Page
{

    protected string ParentID
    {
        get { return Request["ParentID"].ToString(); }
    }
    protected string ParentID1
    {
        get { return Request["ParentID1"].ToString(); }
    }

    protected string MenuType
    {
        get { return string.IsNullOrEmpty(Request["menutype"]) ? "" : Request["menutype"].ToString(); }
    }

    protected void Page_PreRender(object sender, EventArgs e)
    {
           

            //条件 Hashtable

            Hashtable tb = new Hashtable();
            bool QueryAdd = false;

            if (!string.IsNullOrEmpty(RealName.Text.Trim()))
            {
                tb.Add("RealName", RealName.Text.Trim());
                QueryAdd = true;
            }
            if (!string.IsNullOrEmpty(Keyword.Text.Trim()))
            {
                tb.Add("Keyword", Keyword.Text.Trim());
                QueryAdd = true;
            }
            tb = QueryAdd ? tb : null;

            UserDataBind(tb);
    }

    private void UserDataBind(Hashtable QueryTable)
    {

        lv_User.DataSource = new Account().SelectAccount(QueryTable);
        lv_User.DataBind();
    }

    //搜索
    protected void submit_Click(object sender, EventArgs e)
    {

        //条件 Hashtable

        Hashtable tb = new Hashtable();
        bool QueryAdd = false;

        if (!string.IsNullOrEmpty(RealName.Text.Trim()))
        {
            tb.Add("RealName", RealName.Text.Trim());
            QueryAdd = true;
        }
        if (!string.IsNullOrEmpty(Keyword.Text.Trim()))
        {
            tb.Add("Keyword", Keyword.Text.Trim());
            QueryAdd = true;
        }
        tb = QueryAdd ? tb : null;

        UserDataBind(tb);
    }
}
